﻿using System.Collections.Generic;
using System.Drawing;

namespace Triangle
{
    class BinaryRecognizer : IRecognizer
    {
        Bitmap Image{ set; get;}
        /// <summary>
        /// распознает бинарное изображение
        /// </summary>
        /// <returns></returns>
        public int[][] Recognize()
        {
            var result = new List<int[]>();
            for (int j = 0; j < 7; ++j)
            {
                result.Add(new int[6]);
                for (int i = 0; i < 6; ++i)
                    result[i][j] = Image.GetPixel(i, j).Equals(Color.Black) ? 1 : 0;
            }
            return result.ToArray();
        }
        public BinaryRecognizer(Bitmap image)
        {
            Image = image;
        }
    }
}
